﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ERP.Domain.System
{
    /// <summary>
    /// 权限表实体类
    /// </summary>
    public class Permission
    {
        /// <summary>
        /// 权限ID（主键，自增）
        /// </summary>
        [Key]
        public int Id { get; set; }

        /// <summary>
        /// 权限编号（唯一标识）
        /// </summary>
        [StringLength(50)]
        [Required]
        public string PermissionNo { get; set; }

        /// <summary>
        /// 权限名称
        /// </summary>
        [StringLength(100)]
        [Required]
        public string PermissionName { get; set; }

        /// <summary>
        /// 权限类型（1-菜单，2-按钮，3-接口）
        /// </summary>
        public int PermissionType { get; set; }

        /// <summary>
        /// 父级权限ID（用于构建权限树）
        /// </summary>
        public int? ParentId { get; set; }

        /// <summary>
        /// 权限编码（用于前端权限控制）
        /// </summary>
        [StringLength(100)]
        public string PermissionCode { get; set; }

        /// <summary>
        /// 前端路由路径
        /// </summary>
        [StringLength(200)]
        public string RoutePath { get; set; }

        /// <summary>
        /// 前端组件路径
        /// </summary>
        [StringLength(200)]
        public string ComponentPath { get; set; }

        /// <summary>
        /// 排序号
        /// </summary>
        public int SortOrder { get; set; }

        /// <summary>
        /// 权限状态（0-禁用，1-启用）
        /// </summary>
        public bool PermissionStatus { get; set; } = true;
        /// <summary>
        /// 逻辑删除
        /// </summary>
        public bool IsDeleted { get; set; } = false;
    }
}
